package com.example.springmvc.service.impl;

import com.example.springmvc.mapper.UserMapper;
import com.example.springmvc.pojo.User;
import com.example.springmvc.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements IUserService
{
    @Autowired
    UserMapper userMapper;


    @Override
    public List<User> queryList()
    {
        return userMapper.selectByExample(null);
    }

    @Override
    public User findById(int id) {

        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public void removeById(int id) {

        userMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateById(User user) {

        userMapper.updateByPrimaryKeySelective(user);
    }

    @Override
    public void deleteById(User user) {

    }
}
